public class Text {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.creatTree();
        binaryTree.indexOrder(root);
        System.out.println();
        //求二叉树节点个数
        System.out.println("节点个数为：");
        int count = binaryTree.normalNode(root);
        System.out.println(count);
        int count1 = binaryTree.numberNode(root);
        System.out.println(count1);
        //求叶子节点个数
        System.out.println("叶子节点个数：");
        int num = binaryTree.leafNode(root);
        System.out.println(num);
        //求第k层节点个数
        System.out.println("第1层节点个数为：");
        int num1 = binaryTree.countNode(root,1);
        System.out.println(num1);
        System.out.println("第2层节点个数为：");
         num1 = binaryTree.countNode(root,2);
        System.out.println(num1);
        System.out.println("第3层节点个数为：");
         num1 = binaryTree.countNode(root,3);
        System.out.println(num1);
        //查找节点
        System.out.println("查找C节点");
        BinaryTree.TreeNode ret = binaryTree.find(root,'C');
        System.out.println(ret.val);
        //求树的高度
        System.out.println("树的高度为：");
        int num2 = binaryTree.getHeight(root);
        System.out.println(num2);
    }
}
